package com.woniu.model.gh.common.exception;

import com.woniu.model.gh.common.enums.IResultCode;
import lombok.Getter;
import lombok.NoArgsConstructor;

//自定义异常类
//get方法获取结果对象（状态码和错误信息）
@Getter
//无参构造
@NoArgsConstructor
public class BusinessException extends RuntimeException{

    private IResultCode resultCode;

    public IResultCode getResultCode() {
        return resultCode;
    }

    //构造函数，传入实现了IResultCode的resultCode枚举类
    public BusinessException(IResultCode resultCode) {
        //将构造传入的resultCode赋值给上面定义的resultCode
        this.resultCode=resultCode;
    }

}
